package com.agileai.bpm.controller.instance;

import java.util.List;

import com.agileai.bpm.bizmoduler.instance.WfProcessInstanceManage;
import com.agileai.domain.DataParam;
import com.agileai.domain.DataRow;
import com.agileai.hotweb.controller.core.BaseHandler;
import com.agileai.hotweb.renders.DispatchRenderer;
import com.agileai.hotweb.renders.LocalRenderer;
import com.agileai.hotweb.renders.ViewRenderer;

public class WfProcessInstanceStatHandler extends BaseHandler{
	public WfProcessInstanceStatHandler(){
		super();
		this.serviceId = buildServiceId(WfProcessInstanceManage.class);
	}
	public ViewRenderer prepareDisplay(DataParam param){
		mergeParam(param);
		initParameters(param);
		this.setAttributes(param);
		List<DataRow> rsList = getService().findInstanceStatRecords(param);
		this.setRsList(rsList);
		processPageAttributes(param);
		return new LocalRenderer(getPage());
	}
	protected void processPageAttributes(DataParam param) {
		
	}
	protected void initParameters(DataParam param) {
	}
	public ViewRenderer doViewInstanceListAction(DataParam param){
		storeParam(param);
		return new DispatchRenderer(getHandlerURL(WfProcessInstanceListHandler.class));
	}	
	protected WfProcessInstanceManage getService() {
		return (WfProcessInstanceManage)this.lookupService(this.getServiceId());
	}
}	
